package com.xbongbong.paas.service.recheck;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 新建编辑判重策略工厂类
 * @author 杨磊
 * @date 2022-11-15 10 53
 */
@Component
public class RecheckAddRuleFactory {

    @Resource
    private Map<Integer, AbstractRecheckAddEditStrategy>  recheckAddAndEditStrategyMap;

    /**
     * 通过map获取策略，当增加新的策略时无需修改代码，对修改封闭，对扩展开放，遵循开闭原则
     */
    public AbstractRecheckAddEditStrategy getRecheckAddEditStrategy(Integer businessType)  {
        return recheckAddAndEditStrategyMap.get(businessType);
    }
}
